
package yudisium;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;

public class PengendaliPemeriksaanYudisium {
     private static ArrayList<Yudisium> PEMERIKSAAN = new ArrayList<Yudisium>();
    public static Object DAFTAR_MAHASISWA;

    public static ArrayList<Yudisium> getPEMERIKSAAN() {
        return PEMERIKSAAN;
    }

    public static void setPEMERIKSAAN(ArrayList<Yudisium> aPEMERIKSAAN) {
        PEMERIKSAAN = aPEMERIKSAAN;
    }

    public PengendaliPemeriksaanYudisium(Yudisium yudisium) {
        PEMERIKSAAN.add(yudisium);
    }
    
    public static void periksaDataYudisium(Yudisium yudisium){
        PengendaliPemeriksaanYudisium.DAFTAR_MAHASISWA=new ArrayList<Yudisium>();
        Connection conn = OraConnection.open("jdbc:oracle:thin:@localhost:15211:xe", "hr", "bulan");
        java.sql.Statement statement = null;
        try {
            statement = conn.createStatement();
        }
         catch (SQLException ex) {
            Logger.getLogger(PengendaliPemeriksaanYudisium.class.getName()).log(Level.SEVERE, null, ex);
        }
        String sqQ = "select * from yudisium where nim = '" + yudisium.getNim()+"'";
       ResultSet result = null;
        try {
            result = statement.executeQuery(sqQ);
        } catch (SQLException ex) {
            Logger.getLogger(PengendaliPemeriksaanYudisium.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            while (result.next()) {
                Yudisium temp = new Yudisium();
                temp.setNim(result.getString("nim"));
                temp.setNama(result.getString("nama"));
                temp.setProdi(result.getString("prodi"));
                temp.setNomorHp(result.getString("nmrHp"));

//                temp.setPerYud(result.getString("perYud"));

                temp.setPerYudbln(result.getString("perYud"));
                temp.setPerYudtgl(result.getString("perYud"));
                temp.setPerYudthn(result.getString("perYud"));

                temp.setDaftarNilai(result.getString("daftarNilai"));
                temp.setNaskahTA(result.getString("naskahTA"));

//                temp.setPengesahan_skripsi(result.getString("pengesahan_skripsi"));


                temp.setBebasLab(result.getString("bebasLab"));
                temp.setBebasDos(result.getString("bebasDos"));
                temp.setBuktiKP(result.getString("buktiLapKP"));
                temp.setSuratKKL(result.getString("suratKKL"));

//                temp.setFotocopy_tkbi(result.getString("fotocopy_tkbi"));
//                temp.setFotocopy_ta(result.getString("fotocopy_ta"));
//                temp.setSistem_poin(result.getString("sistem_poin"));
//                temp.setBukti_rbm(result.getString("bukti_rbm"));
//                temp.setStatus(result.getString("status"));
//                PengendaliPendaftaranYudisium.DAFTAR_MAHASISWA.add(temp);

                PengendaliPendaftaranYudisium.DAFTAR_MAHASISWA.add(temp);

            }
        } catch (SQLException ex) {
            Logger.getLogger(PengendaliPemeriksaanYudisium.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            conn.close();
        } catch (SQLException ex) {
        }
   }
        public static void LihatTabelMahasiswa(){


        PengendaliPendaftaranYudisium.DAFTAR_MAHASISWA= new ArrayList<Yudisium>();

       Connection conn = OraConnection.open("jdbc:oracle:thin:@localhost:1522:xe", "HR", "dyah");
        java.sql.Statement statement = null;
        try {
            statement = conn.createStatement();
        } catch (SQLException ex) {
            Logger.getLogger(PengendaliPemeriksaanYudisium.class.getName()).log(Level.SEVERE, null, ex);
        }
        String sqQ = "select * from yudisium";
       ResultSet result = null;
        try {
            result = statement.executeQuery(sqQ);
        } catch (SQLException ex) {
            Logger.getLogger(PengendaliPemeriksaanYudisium.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
             while (result.next()) {
                Yudisium temp = new Yudisium();
                temp.setNim(result.getString("nim"));
                temp.setNama(result.getString("nama"));
                temp.setProdi(result.getString("prodi"));
                temp.setNomorHp(result.getString("nmrHp"));

//                temp.setPerYud(result.getString("perYud"));

                temp.setPerYudtgl(result.getString("perYudtgl"));
                temp.setPerYudbln(result.getString("perYudbln"));
                temp.setPerYudthn(result.getString("perYudthn"));

                temp.setDaftarNilai(result.getString("daftarNilai"));
                temp.setNaskahTA(result.getString("naskahTA"));

//                temp.setPengesahan_skripsi(result.getString("pengesahan_skripsi"));

                temp.setBebasLab(result.getString("bebasLab"));
                temp.setBebasDos(result.getString("bebasDos"));
                temp.setBuktiKP(result.getString("buktiLapKP"));
                temp.setSuratKKL(result.getString("suratKKL"));

//                temp.setFotocopy_tkbi(result.getString("fotocopy_tkbi"));
//                temp.setFotocopy_ta(result.getString("fotocopy_ta"));
//                temp.setSistem_poin(result.getString("sistem_poin"));
//                temp.setBukti_rbm(result.getString("bukti_rbm"));
//                temp.setStatus(result.getString("status"));
//                PengendaliPendaftaranYudisium.DAFTAR_MAHASISWA.add(temp);

                PengendaliPendaftaranYudisium.DAFTAR_MAHASISWA.add(temp);

            }
        } catch (SQLException ex) {
            Logger.getLogger(PengendaliPemeriksaanYudisium.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            conn.close();
        } catch (SQLException ex) {
        }
   }

   }
        
 



